package com.atbeijing.bigdata.spark.core.rdd.operator.action

import org.apache.spark.{SparkConf, SparkContext}

object Spark07_Oper_Action {

    def main(args: Array[String]): Unit = {

        val conf = new SparkConf().setMaster("local[*]").setAppName("ActionOperator")
        val sc = new SparkContext(conf)

        // TODO 算子 - 行动
        val rdd = sc.makeRDD(
            List(
                ("a", 1), ("a", 2),("a", 3),
                ("b", 4), ("b", 5),("b", 6)
            ),2
        )

        rdd.saveAsTextFile("output")
        rdd.saveAsObjectFile("output1")
        // saveAsSequenceFile方法必须数据类型为KV类型才可以使用
        rdd.saveAsSequenceFile("output2")





        sc.stop()

    }
}
